package com.colin.springbootsource;

import com.colin.springbootsource.initializer.SecondInitializer;
import com.colin.springbootsource.ioc.annotation.MyBeanImport;
import com.colin.springbootsource.listener.SecondListener;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;

/**
 * @author Colin
 */
@SpringBootApplication
@MapperScan("com.colin.springbootsource.repository")
@Import(MyBeanImport.class)
public class SpringbootSourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootSourceApplication.class, args);
//        SpringApplication springApplication = new SpringApplication(SpringbootSourceApplication.class);
        //硬编码方式向容器中注册监听器的实现,无须SpringBoot容器去发现并构造实例
//        springApplication.addInitializers(new SecondInitializer());
//        springApplication.addListeners(new SecondListener());
//        springApplication.run(args);
    }

}
